using System;
using System.Web.UI;

namespace Mindscape.BackgroundMotion.Website.Controls
{
  public partial class LiveSpacesPhotos : UserControl
  {
    public delegate void LiveSpacesPhotoSelectedDelegate(object sender, EventArgs e);
    public event LiveSpacesPhotoSelectedDelegate PhotoSelected;

    protected void Page_Load(object sender, EventArgs e)
    {
      if (!IsPostBack)
      {
        Page.ClientScript.RegisterClientScriptInclude("LiveBase", "http://dev.live.com/scripts/base/v0.2/live.js");
        Page.ClientScript.RegisterClientScriptInclude("LiveControls",
                                                      "http://dev.live.com/scripts/base/v0.2/controls.js");
      }
    }

    public string PhotoUrl
    {
      get { return SelectedPhotoUrl.Value; }
    }

    protected void SearchButton_Click(object sender, EventArgs e)
    {
      if (PhotoSelected != null)
        PhotoSelected(this, null);
    }
  }
}